<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>All administrators</title>
    </h:head>
    <h:body>

        <p:layout fullPage="true">

            <p:layoutUnit  styleClass="header" position="north" size="120" resizable="true" closable="true" collapsible="true" >
                <p:graphicImage width="1265" height="100" url="./img/header_dataset.jpg" title="DATA SET SIMILARITY"></p:graphicImage>
            </p:layoutUnit>

            <p:layoutUnit position="south" size="50" closable="true" collapsible="true">
                <h:link style="text-align: center" target="./index.xhtml" value="Data set similarity"/>
            </p:layoutUnit>

            <p:layoutUnit position="west" size="200"  header="Menu" collapsible="true" resizable="true">
                <ui:include src="./component/menuAdmin.xhtml"></ui:include>                   
            </p:layoutUnit>

            <p:layoutUnit position="center">


                <h:form>  

                    <p:contextMenu for="admins">  
                        <p:menuitem value="View" update="display" icon="ui-icon-search" oncomplete="adminDialog.show()"/>  
                        <p:menuitem value="Update" update="admins" icon="ui-icon-search" ajax="false" action="#{mbadmin.update()}"/>  
                    </p:contextMenu>  

                    <p:dataTable id="admins" var="admindt" value="#{mbadmin.allAdmins}" 
                                 selectionMode="single" selection="#{mbadmin.updateadmin}" rowKey="#{admindt.adminID}">  
                        <p:column headerText="AdminID">  
                            <h:outputText value="#{admindt.adminID}" />  
                        </p:column>  

                        <p:column headerText="Username">  
                            <h:outputText value="#{admindt.username}" />  
                        </p:column>  

                        <p:column headerText="First name">  
                            <h:outputText value="#{admindt.firstName}" />  
                        </p:column>  

                        <p:column headerText="Last name">  
                            <h:outputText value="#{admindt.lastName}" />  
                        </p:column>  

                        <p:column headerText="E-mail">  
                            <h:outputText value="#{admindt.email}" />  
                        </p:column>  

                    </p:dataTable>  



                    <p:dialog header="Admin Detail" widgetVar="adminDialog" resizable="false"  
                              width="400" showEffect="clip" hideEffect="fold" id="dialog">  

                        <h:panelGrid id="display" columns="2" cellpadding="6">  
                            <h:outputText value="AdminID:" />  
                            <h:outputText value="#{mbadmin.updateadmin.adminID}" style="font-weight:bold"/>  
                            <h:outputText value="Username:" />  
                            <h:outputText value="#{mbadmin.updateadmin.username}" style="font-weight:bold"/>  
                            <h:outputText value="Password:" />  
                            <h:outputText value="#{mbadmin.updateadmin.password}" style="font-weight:bold"/>  
                            <h:outputText value="First name:" />  
                            <h:outputText value="#{mbadmin.updateadmin.firstName}" style="font-weight:bold"/>  
                            <h:outputText value="Last name:" />  
                            <h:outputText value="#{mbadmin.updateadmin.lastName}" style="font-weight:bold"/>  
                            <h:outputText value="Email:" />  
                            <h:outputText value="#{mbadmin.updateadmin.email}" style="font-weight:bold"/>  
                        </h:panelGrid>  
                    </p:dialog>  



                </h:form>  

            </p:layoutUnit>

        </p:layout>

    </h:body>
</html>
